Optimal. Leaf size=177 \[ \frac{\log \left (a+b x+c x^2\right ) \left (-c (a e h+b d h+b e g)+b^2 e h+c^2 (d g+e f)\right )}{2 c^3}-\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (-c^2 (2 a d h+2 a e g+b d g+b e f)+b c (3 a e h+b d h+b e g)+b^3 (-e) h+2 c^3 d f\right )}{c^3 \sqrt{b^2-4 a c}}+\frac{x (-b e h+c d h+c e g)}{c^2}+\frac{e h x^2}{2 c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.349583, antiderivative size = 177, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.179, Rules used = {1628, 634, 618, 206, 628} \[ \frac{\log \left (a+b x+c x^2\right ) \left (-c (a e h+b d h+b e g)+b^2 e h+c^2 (d g+e f)\right )}{2 c^3}-\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (-c^2 (2 a d h+2 a e g+b d g+b e f)+b c (3 a e h+b d h+b e g)+b^3 (-e) h+2 c^3 d f\right )}{c^3 \sqrt{b^2-4 a c}}+\frac{x (-b e h+c d h+c e g)}{c^2}+\frac{e h x^2}{2 c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1628
Rule 634
Rule 618
Rule 206
Rule 628
Rubi steps
\begin{align*} \int \frac{(d+e x) \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx &=\int \left (\frac{c e g+c d h-b e h}{c^2}+\frac{e h x}{c}+\frac{c^2 d f+a b e h-a c (e g+d h)+\left (c^2 (e f+d g)+b^2 e h-c (b e g+b d h+a e h)\right ) x}{c^2 \left (a+b x+c x^2\right )}\right ) \, dx\\ &=\frac{(c e g+c d h-b e h) x}{c^2}+\frac{e h x^2}{2 c}+\frac{\int \frac{c^2 d f+a b e h-a c (e g+d h)+\left (c^2 (e f+d g)+b^2 e h-c (b e g+b d h+a e h)\right ) x}{a+b x+c x^2} \, dx}{c^2}\\ &=\frac{(c e g+c d h-b e h) x}{c^2}+\frac{e h x^2}{2 c}+\frac{\left (c^2 (e f+d g)+b^2 e h-c (b e g+b d h+a e h)\right ) \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{2 c^3}+\frac{\left (2 c^3 d f-b^3 e h-c^2 (b e f+b d g+2 a e g+2 a d h)+b c (b e g+b d h+3 a e h)\right ) \int \frac{1}{a+b x+c x^2} \, dx}{2 c^3}\\ &=\frac{(c e g+c d h-b e h) x}{c^2}+\frac{e h x^2}{2 c}+\frac{\left (c^2 (e f+d g)+b^2 e h-c (b e g+b d h+a e h)\right ) \log \left (a+b x+c x^2\right )}{2 c^3}-\frac{\left (2 c^3 d f-b^3 e h-c^2 (b e f+b d g+2 a e g+2 a d h)+b c (b e g+b d h+3 a e h)\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c^3}\\ &=\frac{(c e g+c d h-b e h) x}{c^2}+\frac{e h x^2}{2 c}-\frac{\left (2 c^3 d f-b^3 e h-c^2 (b e f+b d g+2 a e g+2 a d h)+b c (b e g+b d h+3 a e h)\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^3 \sqrt{b^2-4 a c}}+\frac{\left (c^2 (e f+d g)+b^2 e h-c (b e g+b d h+a e h)\right ) \log \left (a+b x+c x^2\right )}{2 c^3}\\ \end{align*}
Mathematica [A] time = 0.210293, size = 173, normalized size = 0.98 \[ \frac{\log (a+x (b+c x)) \left (-c (a e h+b d h+b e g)+b^2 e h+c^2 (d g+e f)\right )-\frac{2 \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right ) \left (c^2 (2 a d h+2 a e g+b d g+b e f)-b c (3 a e h+b d h+b e g)+b^3 e h-2 c^3 d f\right )}{\sqrt{4 a c-b^2}}+2 c x (-b e h+c d h+c e g)+c^2 e h x^2}{2 c^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.18, size = 510, normalized size = 2.9 \begin{align*}{\frac{eh{x}^{2}}{2\,c}}-{\frac{behx}{{c}^{2}}}+{\frac{dhx}{c}}+{\frac{egx}{c}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) aeh}{2\,{c}^{2}}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ){b}^{2}eh}{2\,{c}^{3}}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) bdh}{2\,{c}^{2}}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) beg}{2\,{c}^{2}}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ) dg}{2\,c}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ) ef}{2\,c}}+3\,{\frac{abeh}{{c}^{2}\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-2\,{\frac{adh}{c\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-2\,{\frac{aeg}{c\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+2\,{\frac{df}{\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-{\frac{{b}^{3}eh}{{c}^{3}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+{\frac{{b}^{2}dh}{{c}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+{\frac{{b}^{2}eg}{{c}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-{\frac{bdg}{c}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-{\frac{bef}{c}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.02193, size = 1361, normalized size = 7.69 \begin{align*} \left [\frac{{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e h x^{2} + \sqrt{b^{2} - 4 \, a c}{\left ({\left (2 \, c^{3} d - b c^{2} e\right )} f -{\left (b c^{2} d -{\left (b^{2} c - 2 \, a c^{2}\right )} e\right )} g +{\left ({\left (b^{2} c - 2 \, a c^{2}\right )} d -{\left (b^{3} - 3 \, a b c\right )} e\right )} h\right )} \log \left (\frac{2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c - \sqrt{b^{2} - 4 \, a c}{\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) + 2 \,{\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e g +{\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d -{\left (b^{3} c - 4 \, a b c^{2}\right )} e\right )} h\right )} x +{\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e f +{\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d -{\left (b^{3} c - 4 \, a b c^{2}\right )} e\right )} g -{\left ({\left (b^{3} c - 4 \, a b c^{2}\right )} d -{\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} e\right )} h\right )} \log \left (c x^{2} + b x + a\right )}{2 \,{\left (b^{2} c^{3} - 4 \, a c^{4}\right )}}, \frac{{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e h x^{2} - 2 \, \sqrt{-b^{2} + 4 \, a c}{\left ({\left (2 \, c^{3} d - b c^{2} e\right )} f -{\left (b c^{2} d -{\left (b^{2} c - 2 \, a c^{2}\right )} e\right )} g +{\left ({\left (b^{2} c - 2 \, a c^{2}\right )} d -{\left (b^{3} - 3 \, a b c\right )} e\right )} h\right )} \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + 2 \,{\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e g +{\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d -{\left (b^{3} c - 4 \, a b c^{2}\right )} e\right )} h\right )} x +{\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e f +{\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d -{\left (b^{3} c - 4 \, a b c^{2}\right )} e\right )} g -{\left ({\left (b^{3} c - 4 \, a b c^{2}\right )} d -{\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} e\right )} h\right )} \log \left (c x^{2} + b x + a\right )}{2 \,{\left (b^{2} c^{3} - 4 \, a c^{4}\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 12.0705, size = 1265, normalized size = 7.15 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.23855, size = 271, normalized size = 1.53 \begin{align*} \frac{c h x^{2} e + 2 \, c d h x + 2 \, c g x e - 2 \, b h x e}{2 \, c^{2}} + \frac{{\left (c^{2} d g - b c d h + c^{2} f e - b c g e + b^{2} h e - a c h e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{3}} + \frac{{\left (2 \, c^{3} d f - b c^{2} d g + b^{2} c d h - 2 \, a c^{2} d h - b c^{2} f e + b^{2} c g e - 2 \, a c^{2} g e - b^{3} h e + 3 \, a b c h e\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{\sqrt{-b^{2} + 4 \, a c} c^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]